<?php
// +----------------------------------------------------------------------
// | 跃飞 [ 将来的你一定会感激现在奋斗的自己 ]
// +----------------------------------------------------------------------
// | Author: 钟贵廷
// +----------------------------------------------------------------------
// | URI1: https://gitee.com/yeafy   URI2:https://github.com/gtzhong
// +----------------------------------------------------------------------
// | weChat:gt845272922  qq:845272922
// +----------------------------------------------------------------------

namespace app\home\controller;

use app\yeafy\observer\demo1\Student;
use app\yeafy\observer\demo1\Teacher;
use app\yeafy\observer\demo2\Member;
use app\yeafy\observer\demo2\Order;
use think\Controller;

class Observer extends Controller
{
    public function index()
    {
        $student  =  new Student();
        $student1  =  new Student();
        $teacher = new Teacher();
        $teacher->observerStudent($student);
        $teacher->observerStudent($student1);
        $student->setState('写作业');
        $student->setState('读书');
        $student->setState('聊天');
        $student->setState('玩手机');
        $student1->setState('玩手机');
    }


    public function order()
    {
        $member = new Member();
        $order = new Order();
        $member->observerOrder($order);
        $order->setState('add');
        $order->setState('pay');
        $order->setState('send');

    }
}